﻿using UnityEngine;
using System.Collections;

public class ElementModel : MonoBehaviour {
	[SerializeField]
	public GameObject modelElement;
	[SerializeField]
	public string Name;
	[SerializeField]
	public int Quantity;
	[SerializeField]
	public string NameImageUp;
	[SerializeField]
	public string NameImageDown;
	
	private Element classElement;
	
	
	public Element GetElement()
	{
		if(classElement == null){
			classElement = new Element();
			classElement.Name=this.Name;
			classElement.ImageUp = this.NameImageUp;
			classElement.ImageDown = this.NameImageDown;
			classElement.Add(this.Quantity);
		}
		return classElement;
	}
    /*
    public void OnTriggerEnter(Collider other)
    {
        switch (other.tag)
        {
            case "Player":
                ScreenGeneral.Neko.Action = EnumTypes.CharactherAction.PickUp;
                Element test = other.GetComponent<ElementModel>().GetElement();
                ScreenGeneral.CollisionElement = test;//other.gameObject.GetComponentInChildren(Element);
                break;
        }
    }

    public void OnTriggerStay(Collider other)
    {

        if (ScreenGeneral.CollisionElement == null)
        {
            Debug.Log(other.tag);
                Destroy(this);
        }
    }

    public void OnTriggerExit(Collider other)
    {
        ScreenGeneral.CollisionElement = null;
        ScreenGeneral.Neko.Action = EnumTypes.CharactherAction.Walk;
    }*/


}
